<?php
/**
 * Created by PhpStorm.
 * User: david
 * Date: 3/21/19
 * Time: 9:54 PM
 */

namespace App\Transformers;


use App\Models\University;
use League\Fractal\TransformerAbstract;

class UniversityTransformer extends TransformerAbstract
{
    public function transform(University $university)
    {
        return [
            'id' => $university->id,
            'name' => $university->name,
            'type' => (int) $university->type,
            'type_name' => (int) $university->type === 0 ? '否' : '是',
        ];
    }
}